projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e248dc4
)
Added doccomment.
author
emellor@ewan
<emellor@ewan>
Tue, 11 Oct 2005 09:30:13 +0000
(10:30 +0100)
committer
emellor@ewan
<emellor@ewan>
Tue, 11 Oct 2005 09:30:13 +0000
(10:30 +0100)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/util/asserts.py
patch
|
blob
|
history
diff --git
a/tools/python/xen/util/asserts.py
b/tools/python/xen/util/asserts.py
index 78f4c1b4a88b857ec50856802f57876e483e1a1a..dd3cb7f85226d5025eaeb995e3ad1f27b6850936 100644
(file)
--- a/
tools/python/xen/util/asserts.py
+++ b/
tools/python/xen/util/asserts.py
@@
-17,6
+17,11
@@
def isCharConvertible(c):
+ """Assert that the given value is convertible to a character using the %c
+ conversion. This implies that c is either an integer, or a character
+ (i.e. a string of length 1).
+ """
+
assert (isinstance(c, int) or
(isinstance(c, str) and
len(c) == 1)), "%s is not convertible to a character" % c